Bacterial overgrowth algorithm